<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('activity/index')}">活动列表</a></li>
        <empty name='info'>
           <li class="active"><a href="{:url('activity/add')}">添加活动</a></li>
        <else/>
            <li class="active"><a href="{:url('activity/add', ['id' => $info.id])}">编辑活动</a></li>
        </empty>

        
    </ul>
    <form class="form-horizontal js-ajax-form margin-top-20" action="{:url('activity/save')}" method="post" enctype="multipart/form-data">
        <notempty name='info'><input type="hidden" name="id" value="{$info.id}" /></notempty>
        <div class="form-group">
            <label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>广告位：</label>
            <div class="col-md-2 col-sm-4">
                <select name='type' class="form-control">
                    <option value="1" <notempty name="info"><if condition="$info.type eq 1">selected</if></notempty> >banner</option>
                    <option value="2" <notempty name="info"><if condition="$info.type eq 2">selected</if></notempty> >常驻入口</option>
                </select>
            </div>
        </div>


        <div class="form-group">
            <label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>活动名称：</label>
            <div class="col-md-2 col-sm-4">
                <input type="text" class="form-control" id="input-name" name="name" placeholder="请输入活动名称" <notempty name='info'>value="{$info.name}"</notempty>>
            </div>
        </div>

        
        <div class="form-group">
            <label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>图标：</label>
             <div class="col-md-6 col-sm-10">
                <p>活动图片</p>
                <input id="photo-1" type="hidden" name="logo" >
                <input id="photo-1-name" type="text" name="photo_name" title="活动图片">
                <img id="photo-1-preview" style="width: 50px;width: 50px" <notempty name='info'>src="/upload/{$info.logo}"</notempty>>
                <a href="javascript:uploadOneImage('图片上传','#photo-1');">上传</a>
            </div>
        </div>
         

        <div class="form-group">
            <label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>跳转链接：</label>
            <div class="col-md-3 col-sm-6">
                <input type="text" class="form-control" id="input-name" name="url" placeholder="请输入活动跳转链接" <notempty name='info'>value="{$info.url}"</notempty>>
            </div>
        </div>

      
        <div class="form-group">
            <label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>开始时间：</label>
            <div class="col-md-2 col-sm-4">
                <input type="datetime-local" class="form-control" id="input-name" name="start_time" <notempty name='info'>value="{$info.start_time}"</notempty>>
            </div>
        </div>


        <div class="form-group">
            <label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>结束时间：</label>
            <div class="col-md-2 col-sm-4">
                <input type="datetime-local" class="form-control" id="input-name" name="end_time" <notempty name='info'>value="{$info.end_time}"</notempty>>
            </div>
        </div>


    
        <div class="form-group">
            <label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>状态：</label>
            <div class="col-md-2 col-sm-4">
                 <select name="status" class="form-control">
                    <option value="1" <notempty name='info'><if condition="$info.status eq 1">selected</if></notempty> >上架</option>
                    <option value="2" <notempty name='info'><if condition="$info.status eq 2">selected</if></notempty> >下架</option>
                </select>
            </div>
        </div>


        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary js-ajax-submit">保存</button>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <span style="color: white;" ><a href="{:url('activity/index')}">返回</a></span>
            </div>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>